package com.leyou.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@AllArgsConstructor(staticName = "of")
@NoArgsConstructor
//@Document("carts")
@Document("#{@collectionNameBuilder.build()}")
public class CartsItem {
    @Id
    //数据查询封装返回时，忽略这个属性
    @JsonIgnore
    private String id;//自定义购物车id，由用户id+商品id组成，原因是前端数据发送没有给定一个购物车id
    @JsonIgnore
    private Long userId;
    private Long skuId;
    private String image;
    private Long num;
    private Long price;
    private String spec;
    private String title;
}
